package com.bjtang.book.entiy;

import java.time.LocalDateTime;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Null;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;

@Data
public class ArticleHead {
	// 主键
	@TableId(type = IdType.AUTO)
	private Long articleNumber;
	// 文章标题
	@Length(min = 0, max = 120)
	private String title;
	// 文章简介
	@Length(min = 0, max = 1000)
	private String summary;
	// 文章题图url
	@Length(min = 0, max = 1000)
	private String pictureUrl;
	// 相关商品
	private Long bookNumber;
	// 文章访问量
	@Null
	private Long traffic;
	// 点赞量
	@Null
	private Long upNumber;
	// 点踩量
	@Null
	private Long downNumber;
	// 推荐次数
	@Null
	private Long recommendNumber;
	// 创建者ID
	@Null
	private Long founder;
	// 创建时间
	@Null
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime creationTime;
	// 文章状态
	@Max(value = 1)
	@Min(value = 0)
	private Integer status;
	// 删除标志
	// 逻辑删除标识(0.未删除,1.已删除)
	@TableLogic
	@TableField(select = false) // 查询结果不显示
	private Integer deleted;
}
